﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UControl_uc_header_new : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Username"] != null)
            {
                if (Session["Username"].ToString() != "")
                {
                    string a = Session["Username"].ToString();
                }
            }
            //HttpCookie cookie = new HttpCookie("SelLang");
            if (Session["SelLang"] != null)
            {
                if (Session["SelLang"].ToString() == "vi")
                {
                    ImgBtn_Vn.Enabled = false;
                    ImgBtn_En.Enabled = true;
                }
                else
                {
                    ImgBtn_En.Enabled = false;
                    ImgBtn_Vn.Enabled = true;
                }
            }
            else
            {
                ImgBtn_En.Enabled = false;
                ImgBtn_Vn.Enabled = true;
            }
        }
    }
    protected void ImgBtn_Vn_Click(object sender, ImageClickEventArgs e)
    {
        //HttpCookie cookie = new HttpCookie("SelLang");
        Session["SelLang"] = "vi";
        //Response.SetCookie(cookie);
        ImgBtn_Vn.Enabled = true;
        ImgBtn_En.Enabled = false;
        Response.Redirect(Request.UrlReferrer.AbsoluteUri);
    }
    protected void ImgBtn_En_Click(object sender, ImageClickEventArgs e)
    {
        //HttpCookie cookie = new HttpCookie("SelLang");
        Session["SelLang"] = "en";
        //Response.SetCookie(cookie);
        ImgBtn_En.Enabled = true;
        ImgBtn_Vn.Enabled = false;
        Response.Redirect(Request.UrlReferrer.AbsoluteUri);
    }
}